package com.softa.web.controller.custom;

import com.softa.bean.LoginReq;
import com.softa.enummodel.LoginEnum;
import com.softa.shiro.authc.CaptchaAuthenticationToken;
import com.softa.utils.Constants;
import com.softa.utils.IpUtil;
import com.softa.web.controller.base.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 注销
 */
@Controller
@RequestMapping("/custom/logout")
public class CustomLogoutController extends BaseController {

    @RequestMapping(method = RequestMethod.GET)
    public String showLoginForm(HttpServletRequest req, Model model) {
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return Constants.MENU_FRONT+"/login";
    }
}
